<template>
	<view style="width:700upx;margin:25upx;">
		<view v-if="!flag">
			<block v-for="(item,index) in orders" :key="index">
			<view class="order_list">
				<view class="list_l">
					<image  :src="baseUrl+item.img"></image>
					<view class="list_info">
						<view class="list_title">{{item.title}}</view>
						<view class="list_from">
							<text>来自：{{item.username}}</text>
						</view>
						<view class="list_time">{{item.time}}</view>
					</view>
				</view>
				<view class="list_r">
					<view class="list_money">
						<text>￥{{item.pay_fee}}</text>
					</view>
					<view class="list_score">
						<text>+{{item.score}}</text>
					</view>
				</view>
			</view>
			</block>
		</view>
		<view v-if="flag">
			<view style="width:100%;margin: 50rpx 0 100rpx;text-align: center;">
				<image src="../../static/nocontent.png" mode="" style="width: 243rpx;height: 200rpx;"></image>
				<view style="color: #999;">
					暂无内容
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	
		import request from '@/common/lib/request.js'
		export default {
			data() {
				return {
					page:1,
					baseUrl:request.common.baseUrl,
					orders:[],
					flag: false
				}
			},
			onLoad:function(){
				uni.request({
					url: request.common.baseUrl+'/api/distributor/teamScore',
					data: {
						token:uni.getStorageSync('keyToken'),
						page:this.page
					},
					header: {
						'Content-Type':'application/json;charset=UTF-8',
						'Content-Type':'application/x-www-form-urlencoded'
					},
					success: (res) => {
						if(res.data.code==200){
							this.orders=res.data.data
						}
						if(this.orders.length == 0){
							this.flag = true
						}else {
							this.flag = false
						}
					}
				});
			},
			methods:{
				
			},
			onReachBottom:function(){
				this.page=this.page+1
				uni.request({
				    url: request.common.baseUrl+'/api/distributor/teamScore',
				    data: {
				    	token:uni.getStorageSync('keyToken'),
				    	page:this.page
				    },
				    header: {
						'Content-Type':'application/json;charset=UTF-8',
						'Content-Type':'application/x-www-form-urlencoded'
				    },
				    success: (res) => {
				        if(res.data.code==200){
							for (var j = 0; j < res.data.data.length; j++) {
								this.orders.push(res.data.data[j])
							}
						}else{
							uni.showToast({
							    title: '暂无数据',
								icon: 'none',
							    duration: 2000
							});
						}
				    }
				});
			}
		}
</script>

<style>
.order_list{
	border-bottom:1upx solid #f6f6f6;
	width:700upx;
	height:200upx;
	padding-top:25upx;
	padding-bottom:25upx;
}
.list_l{
	float:left;
	margin-top:30upx;
}
.list_l image{
	width:200upx;
	height:140upx;
	float:left;
	margin-left:10upx;
}
.list_info{
	width:300upx;
	float:left;
	margin-left:20upx;
}
.list_title{
	font-size:30upx;
	color:#111111;
	width:300upx;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}
.list_from{
	margin-top:8upx;
	margin-bottom:8upx;
}
.list_from text{
	font-size:24upx;
	color:#666666;
	border:1upx solid #f6f6f6;
	border-radius:20upx;
	height:40upx;
	line-height:40upx;
	text-align:center;
	padding:2upx 15upx;
}
.list_time{
	font-size:24upx;
	color:#999999;
}
.list_r{
	float:right;
	margin-top:30upx;
}
.list_money{
	font-size:28upx;
	color:#333333;
}
.list_money text{
	float:right;
}
.list_score{
	font-size:28upx;
	color:#2ed50b;
	margin-top:108upx;
}
.list_score text{
	float:right;
}
</style>
